package cn.iocoder.yudao.module.search.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 搜索引擎类型枚举
 *
 * @author 芋道源码
 */
@AllArgsConstructor
@Getter
public enum SearchEngineTypeEnum {

    ELASTICSEARCH("elasticsearch", "Elasticsearch"),
    OPENSEARCH("opensearch", "OpenSearch"),
    ZINCSEARCH("zincsearch", "ZincSearch"),
    MEILISEARCH("meilisearch", "MeiliSearch");

    /**
     * 类型
     */
    private final String type;

    /**
     * 名称
     */
    private final String name;

    public static SearchEngineTypeEnum getByType(String type) {
        for (SearchEngineTypeEnum value : values()) {
            if (value.getType().equals(type)) {
                return value;
            }
        }
        return null;
    }

}
